<?php

/**
 * This is the model class for table "akseptorkb".
 *
 * The followings are the available columns in table 'akseptorkb':
 * @property integer $akb_id
 * @property integer $akb_kec
 * @property integer $akb_iud
 * @property integer $akb_mop
 * @property integer $akb_pkb
 * @property integer $akb_mow
 * @property integer $akb_implant
 * @property integer $akb_jumlah15
 * @property integer $akb_suntik
 * @property integer $akb_pil
 * @property integer $akb_kondom
 * @property integer $akb_ov
 * @property integer $akb_jml710
 * @property integer $akb_jumlah
 * @property integer $akb_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $akbKec
 */
class Akseptorkb extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Akseptorkb the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'akseptorkb';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('akb_kec, akb_iud, akb_mop, akb_pkb, akb_mow, akb_implant, akb_jumlah15, akb_suntik, akb_pil, akb_kondom, akb_ov, akb_jml710, akb_jumlah, akb_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('akb_id, akb_kec, akb_iud, akb_mop, akb_pkb, akb_mow, akb_implant, akb_jumlah15, akb_suntik, akb_pil, akb_kondom, akb_ov, akb_jml710, akb_jumlah, akb_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'akbKec' => array(self::BELONGS_TO, 'Kecamatan', 'akb_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'akb_id' => 'Akb',
			'akb_kec' => 'Akb Kec',
			'akb_iud' => 'Akb Iud',
			'akb_mop' => 'Akb Mop',
			'akb_pkb' => 'Akb Pkb',
			'akb_mow' => 'Akb Mow',
			'akb_implant' => 'Akb Implant',
			'akb_jumlah15' => 'Akb Jumlah15',
			'akb_suntik' => 'Akb Suntik',
			'akb_pil' => 'Akb Pil',
			'akb_kondom' => 'Akb Kondom',
			'akb_ov' => 'Akb Ov',
			'akb_jml710' => 'Akb Jml710',
			'akb_jumlah' => 'Akb Jumlah',
			'akb_tahun' => 'Akb Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('akb_id',$this->akb_id);
		$criteria->compare('akb_kec',$this->akb_kec);
		$criteria->compare('akb_iud',$this->akb_iud);
		$criteria->compare('akb_mop',$this->akb_mop);
		$criteria->compare('akb_pkb',$this->akb_pkb);
		$criteria->compare('akb_mow',$this->akb_mow);
		$criteria->compare('akb_implant',$this->akb_implant);
		$criteria->compare('akb_jumlah15',$this->akb_jumlah15);
		$criteria->compare('akb_suntik',$this->akb_suntik);
		$criteria->compare('akb_pil',$this->akb_pil);
		$criteria->compare('akb_kondom',$this->akb_kondom);
		$criteria->compare('akb_ov',$this->akb_ov);
		$criteria->compare('akb_jml710',$this->akb_jml710);
		$criteria->compare('akb_jumlah',$this->akb_jumlah);
		$criteria->compare('akb_tahun',$this->akb_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}